function theString = rslice_tide_period_datestring ( gdata )
% RSLICE_TIDE_PERIOD_DATESTRING:
%
% This function doesn't really return a datestring.  It just returns a string
% that is appropriate for the chosen tidal period.
% 
% Currently we have support for
%
% O1:  25.8193
% K1:  23.9345
% N2:  12.6583
% M2:  12.4206
% S2:  12.0000
% M4:   6.2103
% M6:   4.1402

ncfile =  gdata.ncfile_list{gdata.ncfile_index};

tol = 0.001;
tidal_period = nc_varget ( ncfile, gdata.record_variable, gdata.timestep, 1 );

if abs(tidal_period-26.8683) < tol
	theString = 'Q1';
elseif abs(tidal_period-25.8193) < tol
	theString = 'O1';
elseif abs(tidal_period-23.9345) < tol
	theString = 'K1';
elseif abs(tidal_period-12.6583) < tol
	theString = 'N2';
elseif abs(tidal_period-12.4206) < tol
	theString = 'M2';
elseif abs(tidal_period-12.0) < tol
	theString = 'S2';
elseif abs(tidal_period-11.9672) < tol
	theString = 'K2';
elseif abs(tidal_period-6.2103) < tol
	theString = 'M4';
elseif abs(tidal_period-4.1402) < tol
	theString = 'M6';
else
	theString = 'Unrecognized tidal period';
end


return
